import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta:{
      isRoot:true,
      keep:true
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue'),
  },
  {
    path: '/publish',
    name: 'publish',
    component: () => import('../views/publish.vue'),
    meta:{
      isRoot:true,
      keep:true
    }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my.vue'),
    meta:{
      isRoot:true,
      keep:true
    }
  },
  {
    path: '/article',
    name: 'article',
    component: () => import('../views/article.vue'),
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import('../views/reg.vue'),
  },
  {
    path: '/forget',
    name: 'forget',
    component: () => import('../views/forget.vue'),
  },
  {
    path: '/change',
    name: 'change',
    component: () => import('../views/change.vue'),
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('../views/user.vue'),
    meta:{
      auth:true
    }
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/search/search.vue'),
  },
  {
    path: '/SearchResults',
    name: 'SearchResults',
    component: () => import('../views/search/SearchResults.vue'),
  },
  {
    path: '/myrelease',
    name: 'myrelease',
    component: () => import('../views/myrelease.vue'),
  }, 
  {
    path: '/history',
    name: 'history',
    component: () => import('../views/history.vue'),
  },
  {
    path: '/collect',
    name: 'collect',
    component: () => import('../views/collect.vue'),
  },
  {
    path: '/contactUs',
    name: 'contactUs',
    component: () => import('../views/contactUs.vue'),
  },
  {
    path: '/AboutUs',
    name: 'AboutUs',
    component: () => import('../views/AboutUs.vue'),
  },

]

const router = new VueRouter({
  routes
})

export default router
